<template>
    <div class="tab1">
        <Spin v-if="loading" size="large" fix></Spin>
        <Form :model="data" :label-width="160" inline :disabled="true">
            <table style="width:100%;">
                <tr>
                    <td style="width:26%;" colspan="2">
                        <FormItem label="申请人证件号码" prop="azcp0001">
                            <Input v-model="data.azcp0001" placeholder="" @on-blur="loadExistData()"
                                   class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td style="width:29%;" colspan="2">
                        <FormItem label="申请人证件类型" prop="azcp0002">
                            <c-dict-select v-model="data.azcp0002" dictCode="certificatetype"
                                           showKeys="1" :width="180"/>
                        </FormItem>
                    </td>
                    <td style="width:29%;" colspan="2">
                        <FormItem label="申请人姓名" prop="azcp0003">
                            <Input v-model="data.azcp0003" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                    <td style="width:13%;" rowspan="4">
                        <img :src="data.azcp0519" alt="..." class="dbhead-img"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <FormItem label="是否本地户籍" prop="azdf0505">
                            <c-dict-select v-model="data.azdf0505" dictCode="yesorno" :width="180"/>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="申请类型" prop="azdf0509">
                            <c-dict-select v-model="data.azdf0509" dictCode="abaf0110code" :width="180"/>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="家庭类别" prop="azdf0503">
                            <c-dict-select v-model="data.azdf0503" dictCode="abaf0112code" :width="180"/>
                        </FormItem>
                    </td>

                </tr>
                <tr>
                    <td colspan="2">
                        <FormItem label="联系人类型" prop="azdf0510">
                            <c-dict-select v-model="data.azdf0510" dictCode="contact_type" :width="180"/>
                        </FormItem>
                    </td>
                    <td colspan="2">
                        <FormItem label="联系人姓名" prop="azdf0511">
                            <Input v-model="data.azdf0511" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>

                    <td colspan="2">
                        <FormItem label="联系方式" prop="azdf0010">
                            <Input v-model="data.azdf0010" placeholder="" class="itemStyle" :maxlength="11"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="户籍地详细地址" prop="azdf0500">
                            <Input v-model="data.azdf0500" placeholder="" class="itemLongStyle"/>
                        </FormItem>
                    </td>

                    <td colspan="2">
                        <FormItem label="常住地邮政编码" prop="azdf0502">
                            <Input v-model="data.azdf0502" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="常住地详细地址" prop="azdf0008">
                            <Input v-model="data.azdf0008" placeholder="" class="itemLongStyle"/>
                        </FormItem>
                    </td>

                    <td colspan="2">
                        <FormItem label="户籍地邮政编码" prop="azdf0009">
                            <Input v-model="data.azdf0009" placeholder="" class="itemStyle"/>
                        </FormItem>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <FormItem label="所属地行政区划" prop="azdf0007">
                            <area-linkage :areaCode.sync="data.azdf0007"></area-linkage>
                        </FormItem>
                    </td>
                </tr>
            </table>
        </Form>
    </div>
</template>

<script>
    import {postAction} from '@/api/request'
    import {IdentityCodeValid} from '@/plugins/idcardValid.js'
    import {CommonMixin} from '@/views/common/js/CommonMixin'

    const imgSrc = "http://xqimgdl.lngov.top/webhdfs/v1/subsistence/20210824//个人头像20210824105542.p_5184479288.png?op=OPEN&namenoderpcaddress=hadoop01:9000&offset=0";
    export default {
        name: 'application1',
        components: {},
        mixins: [CommonMixin],
        data() {
            return {
                familyInfo: {},
                url: {
                    step1Information: '/api/ac/subsistence/ss11301Service/step1Information',
                },
                loading: false,
                data: {},
            }
        },
        methods: {
            step1Information() {
                this.loading = true;
                var ss12007Id = this.$parent.familyInfo.ss12007Id;
                var that = this;
                postAction(this.url.step1Information, {ss12007Id: ss12007Id}).then((res) => {
                    if (res.data.errcode == 0) {
                        let data = res.data.data;
                        this.data = data;
                        if (!data.azcp0519) {
                            this.data.azcp0519 = imgSrc;
                        }
                    } else {
                        that.$Message.error(res.data.errmsg)
                    }
                }).finally(() => {
                    that.loading = false;
                });
            }
        },
        mounted() {
            this.step1Information();
        },
    }

</script>

<style scoped>
    .dbhead-img {
        height: 160px;
        width: 120px;
        margin-left: 10px;
    }

    /deep/ .ivu-form-item-error-tip {
        display: none;
    }

    .ivu-form-item {
        margin-bottom: 0px;
    }

    .itemStyle {
        width: 180px
    }

    .itemLongStyle {
        width: 450px
    }

    /deep/ .ivu-upload-list {
        display: none;
    }
</style>
